1. Field of the Invention
The invention relates generally to a method and apparatus of sub-pixel rendering of graphic objects, and more particularly, to a method and apparatus for sub-pixel anti-aliased display of typefaces on stripe topology color displays.
2. Description of the Prior Art
Originally, a xe2x80x98bitmapxe2x80x99 was a rectangular array of xe2x80x98bitsxe2x80x99 (0""s or 1""s) which mapped to an array of xe2x80x98pixelsxe2x80x99 (short for picture elements) on a display device, turning the pixel ON or OFF. The term xe2x80x98pixelxe2x80x99 is used to mean both the area of the display and the data mapped to it.
Later, when display devices became capable of displaying more than 2 values, the concepts of pixel and bitmap were extended to provide multiple values. Today, if a bitmap can represent 2n distinct values, it is said to have xe2x80x98n bits per pixelxe2x80x99 or to be xe2x80x98n deepxe2x80x99; each pixel is represented by n bits.
Color displays for stretched the concepts. On a color display a pixel consists of 3 components or xe2x80x98sub-pixelsxe2x80x99, one for each of the red, green and blue primary components of the color. A full description of the data in a color bitmap (or a color pixel) must include the number of bits used to represent each of the components. For example: a common color bitmap on a modem computer is 24 bits deep, having 8 bits for each of red, green and blue; thus it can represent 224 or 16,777,216 different colors.
A stripe topology color display is one in which the three sub-pixels of a pixel are arranged as contiguous vertical bars. Each sub-pixel is roughly three times as high as it is wide, thus each pixel is roughly square. Examples of the stripe topology display are the SONY Trinitron(copyright)CRT (cathode ray tube), and most newer color LCDs (liquid crystal displays). FIG. 1A illustrates a portion of a stripe topology display with pixels composed of contiguous Red, Green and Blue rectangular sub-pixels.
In contrast, a delta topology color display is one in which the sub-pixels of each pixel are roughly circular and are arranged in an equilateral triangle. Most older commercial televisions are of the delta topology. FIG. 1B illustrates a portion of a delta topology color display with pixels composed of contiguous Red, Green and Blue circular sub-pixels. In both FIGS. 1A and 1B the spacing between pixels is exaggerated for clarity.
All color displays use various weighted combinations of the sub-pixels to provide the full color spectrum for each pixel. At normal viewing distances, the human eye doesn""t see the closely spaced color sub-pixels individually, but rather mixes the adjacent colors to form a blend.
Herein, the term xe2x80x98foregroundxe2x80x99 refers to the color of the object to be imaged; and xe2x80x98backgroundxe2x80x99 refers to the color already in place prior to imaging the object.
The term xe2x80x98aliasingxe2x80x99 (also known as the jaggies) is an undesirable effect in which an edge of a graphic object is characterized by a stair-step appearance (see FIGS. 2A and 2B). Aliasing occurs because of the relatively large size of the display pixel, which forces a large incremental change, in comparison with an idealized object of infinite precision. In FIGS. 2A and 2B, pixel values of 255 correspond to black, whereas all other pixel values are 0, corresponding to white. Throughout the drawings all pixel, sub-pixel and bitmap values are equal to 0 unless otherwise indicated.
Typical anti-aliasing techniques operate at the pixel level, by varying certain pixel intensities to give the illusion of greater resolution. For example: in Gupta-Sproull line drawing, the intensity of a pixel is changed based on the perpendicular distance from the ideal line. Pixels on the line are drawn at full foreground intensity; while pixels far from the line are drawn with intensity nearer that of the background. At normal viewing distances, the eye perceives this as a xe2x80x98smoothxe2x80x99 line of constant intensity. (see FIGS. 3A and 3B).
A practical method of generalized anti-aliasing has been derived from sampling theory. It involves computing a weighted average or xe2x80x98filterxe2x80x99 for a small neighborhood around each pixel. A simple example: add twice the value of the target pixel to the values of the pixels above, below, left and right of the target pixel; then divide by 6. In practice, the filters suggested by sampling theory are somewhat more complex than the prior example, but fall into the same broad class of center weighted low pass filters.
For a brief introduction to signal processing, anti-aliasing, and filtering, see sections 3.17, pages 132-40 and 14.10, pages 617-45 of xe2x80x9cComputer Graphics: Principles and Practicexe2x80x9d by Foley et al., Addison Wesley Publishers (2nd edition, 1990). These sections are herein incorporated by reference for supplemental background information which is non-essential, but helpful in understanding the principles of the invention.
It is an object of the present invention to provide an anti-aliasing method and apparatus for use with a stripe topology color display which provides sub-pixel level smoothing in a manner which enhances the apparent resolution of the display, yielding enhanced object shape and positioning, while maintaining accurate foreground and background colors.
The inventive method or apparatus includes the steps or means of: generating a 1 bit per pixel super-sampled bitmap for the image, in which there is greater than or equal to 1 bit for each sub-pixel of the image; determining an average intensity I for each position of the image from the bitmap; determining a sub-pixel intensity S for each sub-pixel using the average intensity I, a foreground intensity F and a background intensity B; and setting a sub-pixel value V for each sub-pixel to produce the sub-pixel intensity on the display. The method can be implemented via code from a computer-readable medium in a computer system.